package net.maxwoods.springcloud;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Date;
import java.util.Map;

@Controller
public class TemplateController {

    @RequestMapping("/")
    public String index(){
        return "index";
    }

    @GetMapping("/web")
    public String web()
    {
        return "redirect:/test.html";
    }

    @RequestMapping("/hello")
    public String hello(Model model)
    {
        model.addAttribute("name","maxwoods");
        model.addAttribute("time",new Date());
        return "/hello";
    }

}
